<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Santas Helper - Children - View</title>
	</head>
	<body>
		<header>
			<h1>Children</h1>
			<h2>${child.name }</h2>
		</header>
		<section>
			<h3>Address</h3>
			<address>
				<p>${child.address.text }</p>
			</address>
			<a href="../../addresses/update/${child.id }/${child.address.id }">Edit</a>
			<br>
			<br>
			<h3>Gifts</h3>
			<table>
				<tr>
					<th>ID</th>
					<th>Description</th>
					<th></th>
					<th></th>
				</tr>
				<c:forEach items="${child.gifts }" var="gift">
					<tr>
						<td>${gift.id }</td>
						<td>${gift.description }</td>
						<td><a href="../../gifts/update/${gift.id }">Edit</a></td>	
						<td><a href="../../gifts/delete/${gift.id }">Delete</a></td>
					</tr>
				</c:forEach>
			</table>
			<br>
			<a href="../../gifts/create/${child.id }">Add New</a>
			<br>
			<br>
			<br>
			<a href="../list">Back to list</a>
		</section>
		<footer>
			<p>&nbsp;</p>
			<p>&copy; 2012 North Pole Productions</p>
		</footer>
	</body>
</html>